import { request } from '@/utils/request';

export interface Classify {
  name: string;
  _id: string;
  sort: number;
  picurl: string;
  select: boolean;
  updateTime: string;
}
export interface ClassifyWallList {
  description: string;
  _id: string;
  classid: string;
  smallPicurl: string;
  picurl?: string;
  score: string;
  nickname: string;
  tabs: string[];
  userScore?: string;
}
export interface SetupScore {
  id: string;
}

export const apiGetClassify = (data: { select?: boolean; pageSize?: number } = {}) => {
  return request<Classify[]>('/classify', {
    data,
  });
};

export const apiGetClassifyWallList = (data: { classid?: string; pageSize?: number; pageNum?: number } = {}) => {
  console.log('apiGetClassifyWallList', data);

  return request<ClassifyWallList[]>('/wallList', {
    data,
  });
};

export const apiSetupScore = (data: { classid: string; wallId: string; userScore: string }) => {
  return request<SetupScore>('/setupScore', {
    data,
  });
};

export const apiDetailWall = (data: { id: string }) => {
  return request<ClassifyWallList[]>('/detailWall', {
    data,
  });
};
